<?xml version="1.0" encoding="UTF-8"?>
<ui:composition template="/WEB-INF/templates/master_frame.xhtml"
	xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:a4j="http://richfaces.org/a4j"
	xmlns:rich="http://richfaces.org/rich"
	xmlns:my="http://java.sun.com/jsf/composite/components">

	<ui:define name="title"> - User Listing</ui:define>

	<ui:define name="content">

		<h:outputScript target="body" name="custom/showMessage.js" library="js"/>	
		<h:form id="reg">

			<rich:panel id="userPanel" header="User Registration" headerClass="">
				<p>Enforces annotation-based constraints defined on the model
					class.</p>
				<my:userForm user="#{newUser}" />
				<h:panelGrid columns="2">
					<a4j:commandLink styleClass="pro_btn" id="register"
						action="#{userController.register}" onerror="alert(event.rf.data)"
						value="Register" execute="userPanel" render="userPanel" />
					<rich:messages globalOnly="true" />
				</h:panelGrid>
			</rich:panel>
			<br />


			<div id="newMessages" class="update">newMessages</div>	


			<a4j:push address="pushCdi"
				ondataavailable="showMessage('newMessages', event.rf.data)">
				<a4j:ajax event="dataavailable" onerror="alert(event.rf.data)"
					render="userList" />
			</a4j:push>


		</h:form>

	</ui:define>
</ui:composition>
